<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('跑马灯')" />
</head>
<body class="gray-bg">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="pmd-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                内容：<input type="text" name="content"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="biz:pmd:add">
                    <i class="fa fa-plus"></i> 新增
                </a>
                <a class="btn btn-primary btn-edit disabled" onclick="$.operate.editTab()" shiro:hasPermission="biz:pmd:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="biz:pmd:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" data-mobile-responsive="true"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: summernote-js"/>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('biz:pmd:edit')}]];
        var detailFlag = [[${@permission.hasPermi('biz:pmd:detail')}]];
        var prefix = ctx + "biz/pmd";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                modalName: "跑马灯",
                detailUrl: prefix + "/detail/unit/{id}",
                columns: [{
                    checkbox: true
                },
                    {
                        field : 'id',
                        title : 'ID'
                    },
                    {
                        field : 'speed',
                        title : '速度'
                    },
                    {
                        field : 'content',
                        title : '内容'
                    },
                    /*{
                        field : 'createBy',
                        title : '创建人'
                    },
                    {
                        field : 'createTime',
                        title : '创建时间'
                    },{
                        field : 'updateBy',
                        title : '修改人'
                    },
                    {
                        field : 'updateTime',
                        title : '修改时间'
                    },*/
                    {
                        field : 'remark',
                        title : '备注'
                    },
                    {
                        title: '操作',
                        align: 'center',
                        formatter: function(value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="#" onclick="$.operate.detailTab(\'' + row.id + '\')"><i class="fa fa-file-text"></i>查看详情</a> ');
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            return actions.join('');
                        }
                    }]
            };
            $.table.init(options);
        });
    </script>

</body>
</html>